function notice_init(){
	var cur_idx = null;
	try{
		JCalendar.onclick = function(year, month, date) {
			$("#cal_val_" + cur_idx).val(year + "-" + month + "-" + date);

			if(layer){
				layer.hide();	
			}
		}
	}catch(e){
		return;
	}

	var layer = $("<div></div>").css({
			"display": "none",
			"position": "absolute",
			"z-index": "2010"
			}).html(new JCalendar().show()).appendTo(document.body);

	$(".click_calendar").click(function() {
			layer.show();
			var pos = $(this).offset();
			layer.css({
				"left": pos.left,
				"top": pos.top 
				});

			cur_idx = $(this).attr("id").split("_").pop();

			return false;
			});
	$(document).click(function(){layer.hide();});
}
$(document).ready(function(){notice_init();});
